package com.example.andylau96.res.DataBase;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by AndyLau96 on 2016/12/14.
 */
public class CashierDataBase extends SQLiteOpenHelper
{
    public final static int version = 1;
    public final static String dbName = "CashierDataBase";
    public CashierDataBase(Context t)
    {
        super(t,dbName,null,version);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table OrderInfo(orderID integer primary key,orderTime varchar,comingTime varchar,tablesNum integer,peopleNum integer,foodID varchar)");
        db.execSQL("create table DinningInfo(dinningID varchar primary key,peopleNum integer,foodID varchar,accounts double)");
        db.execSQL("create table ConsumeItem(itemID integer primary key,itemPrice double,itemName varchar)");
        db.execSQL("create table Erji(itemID integer primary key,itemName varchar,itemNum integer)");

        db.execSQL("insert into DinningInfo values('1101',50,'5-5-5-5-5-5-5-5-5-5-5-55-5-5-5-5',555.55)");
        db.execSQL("insert into DinningInfo values('110101',50,'5-5-5-5-5-5-5-5-5-5-5-55-5-5-5-5',5885)");
        db.execSQL("insert into DinningInfo values('2201',50,'5-5-5-5-5-5-5-5-5-5-5-55-5-5-5-5',666)");
        db.execSQL("insert into DinningInfo values('2301',50,'5-5-5-5-5-5-5-5-5-5-5-55-5-5-5-5',777)");
        db.execSQL("insert into DinningInfo values('1023',50,'5-5-5-5-5-5-5-5-5-5-5-55-5-5-5-5',58885)");

        db.execSQL("insert into ConsumeItem values(1001,3.5,'可口可乐')");
        db.execSQL("insert into ConsumeItem values(1002,25,'极品二锅头')");
        db.execSQL("insert into ConsumeItem values(1003,32,'肝腰合炒')");
        db.execSQL("insert into ConsumeItem values(1004,65,'水煮牛肉')");
        db.execSQL("insert into ConsumeItem values(1005,1000,'佛跳墙')");
        db.execSQL("insert into ConsumeItem values(1006,8,'雪花勇闯天涯')");
        db.execSQL("insert into ConsumeItem values(1007,10,'惟怡豆奶')");
        db.execSQL("insert into ConsumeItem values(1008,5,'鲜橙多')");
        db.execSQL("insert into ConsumeItem values(1009,8,'王老吉')");
        db.execSQL("insert into ConsumeItem values(1010,50,'泸州老窖')");
        db.execSQL("insert into ConsumeItem values(1011,5,'雪碧')");
        db.execSQL("insert into ConsumeItem values(1012,5,'脉动')");
        db.execSQL("insert into ConsumeItem values(1013,900,'茅台')");
        db.execSQL("insert into ConsumeItem values(1014,2.5,'豆浆')");
        db.execSQL("insert into ConsumeItem values(1015,100,'枸杞酒')");
        db.execSQL("insert into ConsumeItem values(1016,10,'西瓜汁')");

        db.execSQL("insert into Erji values(1001,'可口可乐',1000)");
        db.execSQL("insert into Erji values(1002,'极品二锅头',650)");
        db.execSQL("insert into Erji values(1006,'雪花勇闯天涯',588)");
        db.execSQL("insert into Erji values(1007,'惟怡豆奶',333)");
        db.execSQL("insert into Erji values(1008,'鲜橙多',250)");
        db.execSQL("insert into Erji values(1009,'王老吉',300)");
        db.execSQL("insert into Erji values(1010,'泸州老窖',53)");
        db.execSQL("insert into Erji values(1011,'雪碧',500)");
        db.execSQL("insert into Erji values(1012,'脉动',500)");
        db.execSQL("insert into Erji values(1013,'茅台',50)");
        db.execSQL("insert into Erji values(1014,'豆浆',9999)");
        db.execSQL("insert into Erji values(1015,'枸杞酒',9999)");
        db.execSQL("insert into Erji values(1016,'西瓜汁',999)");
    }
    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
